import Vue from 'vue'
import Router from 'vue-router'
import kim from './kim';
const login = resolve => require(['@/pages/login'], resolve);
// const commodity = resolve => require(['@/components/commoditymanagement'], resolve);
// const store = resolve => require(['@/components/storemanagement'], resolve);
const supplier = resolve => require(['@/containers/supplierManagement'], resolve);
const supplierSole = resolve => require(['@/containers/supplierManagementSole'], resolve);
const storageStore = resolve => require(['@/containers/storageStoreManagement'], resolve);
const stork = resolve => require(['@/containers/storkManagement'], resolve);
// const production = resolve => require(['@/components/productionmanagement.vue'], resolve);
const crm = resolve => require(['@/containers/crm'], resolve);
const merchandise = resolve => require(['@/containers/merchandiseManagement'], resolve);
// const warehouse = resolve => require(['@/components/warehousemanagement.vue'], resolve);
// const market = resolve => require(['@/components/marketingmanagement.vue'], resolve);
// const account = resolve => require(['@/components/accountmanagement.vue'], resolve);
// const system = resolve => require(['@/components/systemconfig.vue'], resolve);
// pages
import supplierPages from './supplier'
import supplierSolePages from './supplierSole'
import storageStorePages from './storageStore'
import storkPages from './stork'
import crmPages from './crm'
import merchandisePages from './merchandise'

Vue.use(Router)

export default new Router({
  // mode:'history',
  routes: [{
      path: '/',
      name: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    /*{
      path: '/commodity',
      name: 'commodity',
      component: commodity
    },
    {
      path: '/store',
      name: 'store',
      component: store
    },*/
		// {
		//   path: '/supplier',
		//   name: 'supplier',
		//   redirect: '/supplier/offerConver',
		//   component: supplier,
		//   children: [
		//     ...supplierPages
		//   ]
		// },
		// {
		//   path: '/storageStore',
		//   name: 'storageStore',
		//   redirect: '/storageStore/afterSaleWarehousingStore',
		//   component: storageStore,
		//   children: [
		//     ...storageStorePages
		//   ]
		// },
		// {
		//   path: '/stork',
		//   name: 'stork',
		//   redirect: '/stork/storeStorkStatistics',
		//   component: stork,
		//   children: [
		//     ...storkPages
		//   ]
		// },
		
    {
      path: '/crm',
      name: 'crm',
      component: crm,
    //   redirect: '/crm/customerList',
      children: [
        ...crmPages
      ]
    },
    // {
    //   path: '/supplierSole',
    //   name: 'supplierSole',
    //   redirect: '/supplierSole/offerInfoSole',
    //   component: supplierSole,
    //   children: [
    //     ...supplierSolePages
    //   ]
    // },
    // {
    //   path: '/production',
    //   name: 'production',
    //   component: production
    // },

    // {
    //   path: '/market',
    //   name: 'market',
    //   component: market
    // },
    // {
    //   path: '/account',
    //   name: 'account',
    //   component: account
    // },
    // {
    //   path: '/system',
    //   name: 'system',
    //   component: system
    // },

    // {
    //   path: '/merchandise',
    //   name: 'merchandise',
    //   redirect: '/merchandise/larger',
    //   component: merchandise,
    //   children: [
    //     ...merchandisePages
    //   ]
    // },
    // ...kim,
  ]
})
